<template>
  <div class="home-page">
    <section class="pl-5 text-center container">
      <div class="row py-lg-5">
        <div class="col-lg-6 col-md-8 mx-auto">
          <img src="../assets/patterns.e8579768.png" alt="" class="w-50" />
          <h2>随心写作，自由表达</h2>
          <a href="#" class="btn btn-primary my-2">开始写文章</a>
        </div>
      </div>
    </section>
    <h4 class="font-weight-bold text-center">发现精彩</h4>
    <!--专栏列表-->
    <ColmunList :list="list"></ColmunList>
  </div>
</template>

<script lang="ts">
import { computed, defineComponent, onMounted } from 'vue'
import { useStore } from 'vuex'
import GlobalHeader from '@/components/GlobalHeader.vue'
import ColmunList from '../components/ColmunList.vue'
import { GolbalDataProps } from '../store'
export default defineComponent({
  components: {
    ColmunList
  },
  setup () {
    const store = useStore<GolbalDataProps>()
    const list = computed(() => store.state.columns)

    const biggerColumnLen = computed(() => store.getters.biggerColumnLen)
    // 组件挂载的使用调用 请求
    onMounted(() => {
      store.dispatch('fetchColumns')
    })
    return {
      list: list,
      biggerColumnLen
    }
  }
})
</script>

<style scoped></style>
